using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class FileUploadPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        String savePath = @"C:\Downloads\";
        if (FileUpload1.HasFile)
        {
            String fileName = FileUpload1.FileName;
            savePath += fileName;
            
            HttpPostedFile  file = FileUpload1.PostedFile;             
            if(file.ContentLength<=100000)
            {
             
                FileUpload1.SaveAs(savePath);
                Label1.Text = "Your file was saved as " + fileName;
            }
            else
            {
                Label1.Text = "Sorry, your file was big size ";
            }
        }
        else
        {
            Label1.Text = "You did not specify a file to upload.";
        }

    }
}
